package com.cwj.redisson;

import org.redisson.Redisson;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;

import java.util.concurrent.TimeUnit;

public class Test {
    public static void main(String[] args) {
        RedissonClient redissonClient = Redisson.create();
        RLock myLock0 = redissonClient.getLock("myLock0");
        RLock rLock = redissonClient.getRedLock(myLock0);
        rLock.lock();
        rLock.lock(1l, TimeUnit.DAYS);
        System.out.println("I`m locked");
        rLock.unlock();
        System.out.println(Integer.toBinaryString(16384));
    }
}
